package com.global.domain;

import java.util.List;

import com.global.emc.core.CoreRole;

/**   
 *  
 * @Description:  [角色]   
 * @Author:       [Joly_Huang]   
 * @CreateDate:   [2014年3月18日 上午10:34:38]   
 * @UpdateUser:   [Joly_Huang]   
 * @UpdateDate:   [2014年3月18日 上午10:34:38]   
 * @UpdateRemark: [说明本次修改内容]  
 * @Version:      [v1.0] 
 *    
 */
public class Role implements CoreRole {
	
	private int id;
	private String roleName;
	private Role parentRole;
	private List<Role> subRoles;
	private List<Authority> authorities;
	
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getRoleName() {
		return roleName;
	}
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	public Role getParentRole() {
		return parentRole;
	}
	public void setParentRole(Role parentRole) {
		this.parentRole = parentRole;
	}
	public List<Role> getSubRoles() {
		return subRoles;
	}
	public void setSubRoles(List<Role> subRoles) {
		this.subRoles = subRoles;
	}
	public List<Authority> getAuthorities() {
		return authorities;
	}
	public void setAuthorities(List<Authority> authorities) {
		this.authorities = authorities;
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Role other = (Role) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
	
	@Override
	public String toString() {
		return "Role [id=" + id + ", roleName=" + roleName + "]";
	}
	
}
